package com.zhangmengyuan.medical.service.impl;

import com.zhangmengyuan.medical.dao.ClassEntityDao;
import com.zhangmengyuan.medical.entity.ClassEntity;
import com.zhangmengyuan.medical.service.ClassEntityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClassEntityServiceImpl implements ClassEntityService{
    @Autowired
    private ClassEntityDao classEntityDao;
    @Override
   public void save(ClassEntity classEntity) {
        classEntityDao.save(classEntity);
    }

    @Override
    public List<ClassEntity> getAll() {
        return classEntityDao.findAll();
    }

    @Override
    public ClassEntity getById(Integer classId) {
        return classEntityDao.findOne(classId);
    }


}
